<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class OrderReturn extends Model
{
    use HasFactory;
    protected $table = 'sp_order_return_2';
    protected $primaryKey = 'id';
    public $timestamps = false;

    const ORDER_EXPRESS_TYPE_DELIVERY = 1;//发货
    const ORDER_EXPRESS_TYPE_RETURN = 2;//归还退货

    const ORDER_DELIVERY_TYPE_EXPRESS = 1;//快递物流
    const ORDER_DELIVERY_TYPE_SELF = 2;//上门自取
    const ORDER_DELIVERY_TYPE_INSTALL = 3;//上门安装

    const ORDER_EXPRESS_STATUS_DELIVERED = 1;//已发货
    const ORDER_EXPRESS_STATUS_TRANSIT = 2;//运输中
    const ORDER_EXPRESS_STATUS_SIGNED = 3;//已签收

    const EXPRESS_CHECK_STATUS = 1;//快递100已签收状态

    public static function checkOrderLogisticsNo($logistics_no){
        if(OrderReturn::where('logistics_no',trim($logistics_no))->count() > 0){
            return false;
        }else{
            return true;
        }
    }

}
